autocmd BufRead,BufNewFile *.groovy set tags+=~/src/groovy_src/tags,~/src/jdk11_src/tags
autocmd FileType javascript setlocal equalprg=js-beautify\ -f\ -\ -s\ 4\ -B
" autocmd FileType html setlocal equalprg=html-beautify\ -f\ -\ -s\ 4\ -B
autocmd FileType css setlocal equalprg=css-beautify\ -f\ -\ -s\ 4\ -B
autocmd FileType python setlocal equalprg=yapf

" autocmd FileType html noremap <buffer> <c-f> :call HtmlBeautify()<cr>
au VimEnter * call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#151515')
au VimEnter * call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#151515')
au VimEnter * call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#151515')
au VimEnter * call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#151515')
au VimEnter * call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#151515')
au VimEnter * call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#151515')
au VimEnter * call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#151515')
au VimEnter * call NERDTreeHighlightFile('html', 'yellow', 'none', 'yellow', '#151515')
au VimEnter * call NERDTreeHighlightFile('styl', 'cyan', 'none', 'cyan', '#151515')
au VimEnter * call NERDTreeHighlightFile('css', 'cyan', 'none', 'cyan', '#151515')
au VimEnter * call NERDTreeHighlightFile('coffee', 'Red', 'none', 'red', '#151515')
au VimEnter * call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', '#151515')
au VimEnter * call NERDTreeHighlightFile('rb', 'Red', 'none', '#ffa500', '#151515')
au VimEnter * call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#151515')
autocmd VimEnter * call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#151515')
autocmd FileWritePre    * :call TrimWhiteSpace()
autocmd FileAppendPre   * :call TrimWhiteSpace()
autocmd FilterWritePre  * :call TrimWhiteSpace()
autocmd BufWritePre     * :call TrimWhiteSpace()

au TabLeave * let g:lasttab = tabpagenr()

" Javascript syntax fix
autocmd BufRead *.jsx set syntax=javascript

au BufWinLeave * silent! mkview
au BufWinEnter * silent! loadview
" au BufWrite * mkview
" au BufWinLeave * mkview
" au BufRead * silent! loadview
autocmd BufEnter * :syntax sync fromstart


autocmd CursorHold * silent call CocActionAsync('highlight')



au WinEnter * setlocal cursorline
au WinLeave * setlocal nocursorline
" indentLine
autocmd FileType json,markdown let g:indentLine_conceallevel = 0
" vim-json
autocmd FileType json,markdown let g:vim_json_syntax_conceal = 0

